#include "../../ocl/driver.h"
#include "../../mds/vector.h"

int main(int argc, char *argv[])
{
	
	cl_uint      i,j;
	ocl_driver * OpenCL  = NULL;
	
	if( argc > 1 && 0 == strcmp( "-v", argv[1] ) )
		ocl_logfile = stderr;
	OpenCL      = ocl_driver_load();
	
	if( !OpenCL )
	{
		ocl_perror( stderr, "during intialization");		
		return -1;
	}
	
	fprintf( stderr, "sizeof(Real)=%d\n", (int) sizeof(Real) );
	if( sizeof(mds_vector) != sizeof(Real4) )
	{
		fprintf( stderr, "doesn't match !!!\n");
	}
	else {
		fprintf( stderr, "perfect match !!!\n");
	}
	
	for( i =0; i < OpenCL->num_platforms; ++i )
	{
		const ocl_platform *P = OpenCL->platforms + i;
		for( j=0; j < P->num_devices; ++j )
		{
			const ocl_device *D = P->devices + j;
			fprintf( stderr, "\t(%u:%u) '%s'\n", i,j,D->NAME);
			fprintf( stderr, "\t\t max_alloc_real4     = %u\n", (unsigned) ocl_device_max_alloc_real4(D) );
			fprintf( stderr, "\t\t max_local_real4     = %u\n", (unsigned) ocl_device_max_local_real4(D) );
			fprintf( stderr, "\t\t max_work_group_size = %u\n", (unsigned) D->MAX_WORK_GROUP_SIZE );
		}
		
	}
	
	
	fprintf( stderr, "[OpenCL] total_bytes= %llu\n", (unsigned long long)mds_bytes );
	ocl_driver_quit();
	fprintf( stderr, "[OpenCL] total_bytes= %llu\n", (unsigned long long)mds_bytes );
	
	
	
	
	return 0;
}
